<?php
namespace app\circle\validate;

use think\Validate;

/**
 * 验证
 */
class Like extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'type'          => 'require|in:1,2',
        'obj_id'        => 'require|integer',
        'status'        => 'require|in:1,0',
    ];

    protected $field = [
        'type'          => '点赞对象',
        'obj_id'        => '点赞对象',
        'status'        => '点赞状态',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'like'      => ['type', 'obj_id', 'status'],
    ];

}
